package wgetservice

import "go.uber.org/fx"

type Param struct {
	fx.In
	NetService *NetService `name:"NetService"`
}

type Result struct {
	fx.Out
	NetService *NetService `name:"NetService"`
}

func (f *Result) Execute(service *NetService) error {
	f.NetService = service
	return nil
}

func NewCurl() (*NetService, error) {
	service := NewNetService()
	return &service, nil
}

var Module = fx.Module("WgetService", fx.Provide(
	func() (out Result, err error) {
		if svc, e := NewCurl(); e != nil {
			err = e
		} else {
			err = out.Execute(svc)
		}
		return
	},
),
)
